package DailyPractice.Day29;

import java.util.Scanner;

/**
 * 分辨假币
 * @author lumin
 * @date 2022/05/26 19:58
 **/
public class Num2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int m = sc.nextInt();
            if(m == 0){
                break;
            }else if(m == 1){
                System.out.println("0");
            }else if(m >= 1 && m <= 3){
                System.out.println("1");
            }else{
                int count = 1;
                while(m > 3){
                    if(m / 3 == 0){
                        m = m / 3;
                    }else{
                        m = (m / 3) + 1;
                    }
                    count++;
                }
                System.out.println(count);
            }
        }
    }
}